      package cn.com.cal;
      
      import cn.com.glopool.GloPool;
      import cn.com.common.Poke;
      public class PokeCalVo
      {
        private Poke[] winpoke;
        private GloPool pool;
        private int seatid;
        private int pokestyle;
        private boolean if_zhan=false; //庄
        private int nuvalue;          //牛值
        private int[] cardArray=new int[5];//牌数组
      
        public PokeCalVo(int style, Poke[] list)
        {
           this.pokestyle = style;
           this.winpoke = list;
        }
      
        
        /**
    	 * 排序
    	 * 返回任意位大小值
    	 */
    	public Poke getNuSort(int n)
    	{
    		int [] sortArray=new int[5];
    		for(int i=0;i<5;i++)
    		{
    			Poke poke=(Poke)winpoke[i];
    			sortArray[i]=poke.getValue();
    		}
    		
    		//冒泡排序
    		Poke k;
    		int icount=0;
    		boolean b=false;
    		for(int j=0;j<winpoke.length-1;j++)
    		{
    			b=false;
    			for(int i=0;i<winpoke.length-1;i++)
    			{
    				if(winpoke[i].getValue()>winpoke[i+1].getValue())
    				{
    					k=winpoke[i];
    					winpoke[i]=winpoke[i+1];
    					winpoke[i+1]=k;
    					b=true;
    					}
    					icount++;
    			}
    					if(!b) 
    					break;
    		}
    		
    		return winpoke[5-n];
    	}
        
        
        public int getValue(int i)
        {
          return this.winpoke[i].getValue();// & 0xFF;
        }
      
        public int getSharp(int i)
        {
          return this.winpoke[i].getShap();// >> 8;
        }
      
        public String getLogSharp(int i)
        {
          String str = "";
          switch (getSharp(i))
          {
          case 4:
           str = "黑桃";
            break;
          case 3:
            str = "红桃";
            break;
          case 2:
            str = "梅花";
            break;
          case 1:
            str = "方块桃";
          }
      
          return str;
        }
      
        public int getPokestyle()
        {
          return this.pokestyle;
        }
      
        public String getLogPokeStyle() {
          String str = "";
          switch (getPokestyle())
          {
//          private final static int TYPE_FIVEXIAO=16;           //"五小";单张小于五，总和小于等于10
//	      	private final static int TYPE_FIVEHUA=15;            //"五花";五张大于10的牌
//	      	private final static int TYPE_FOURZAI=14;			//"四炸";四张一样的牌
//	      	private final static int TYPE_YINNUI = 13;		    //"银牛";一张10其于为10以上的牌
//	      	private final static int TYPE_NUINUI = 12;			//"牛牛";
//	      	private final static int TYPE_NUI = 11;		        //"牛";
//	      	private final static int TYPE_MEINUI = 10;			//"没";
          case 10:
            str = "没牛";
            break;
          case 11:
            str = "牛";
            break;
          case 12:
            str = "牛牛";
            break;
          case 13:
            str = "银牛";
            break;
          case 14:
            str = "四炸";
            break;
          case 15:
            str = "五花";
            break;
          case 16:
            str = "五小";
            break;
          }
      
          return str;
        }
        public void setPokestyle(int pokestyle) 
        {
           this.pokestyle = pokestyle;
        }
        public Poke[] getWinpoke() {
           return this.winpoke;
        }
        public void setWinpoke(Poke[] winpoke) 
        {
           this.winpoke = winpoke;
        }
        public int getSeatid() {
           return this.seatid;
        }
        public void setSeatid(int seatid) 
        {
           this.seatid = seatid;
        }
        public GloPool getPool() 
        {
           return this.pool;
        }
        public void setPool(GloPool pool) 
        {
           this.pool = pool;
        }

		/**
		 * @return the if_zhan
		 */
		public boolean isIf_zhan() 
		{
			return if_zhan;
		}

		/**
		 * @param if_zhan the if_zhan to set
		 */
		public void setIf_zhan(boolean if_zhan) 
		{
			this.if_zhan = if_zhan;
		}

		/**
		 * @return the cardArray
		 */
		public int[] getCardArray() 
		{
			return cardArray;
		}

		/**
		 * @param cardArray the cardArray to set
		 */
		public void setCardArray(int[] cardArray)
		{
			this.cardArray = cardArray;
		}

		/**
		 * @return the nuvalue
		 */
		public int getNuvalue() 
		{
			return nuvalue;
		}

		/**
		 * @param nuvalue the nuvalue to set
		 */
		public void setNuvalue(int nuvalue) 
		{
			this.nuvalue = nuvalue;
		}
       }
